package cn.wolfcode.wechat.query;

import cn.wolfcode.wechat.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class ClientQueryObject extends QueryObject {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private int subscribe = -1;
    private String keyword;

    public Long getEndDateTime(){
        return this.endDate == null ? null:DateUtil.getEndDate(this.endDate).getTime();
    }

    public Long getBeginDateTime(){
        return this.beginDate == null ? null : this.beginDate.getTime();
    }
}
